# Maintainers: James Spencer <james.s.spencer@gmail.com>
#              Darjan Krijan [https://disc-kuraudo.eu]

_realname=cubelib
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=4.8
pkgrel=1
pkgdesc="Library for reading and writing a multi-dimensional performance space (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
url="http://www.scalasca.org/software/cube-4.x/download.html"
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-qt5-base")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc") 
#options=('staticlibs')
source=("https://apps.fz-juelich.de/scalasca/releases/cube/${pkgver}/dist/${_realname}-${pkgver}.tar.gz")
sha256sums=('171C93AC5AFD6BC74C50A9A58EFDAF8589FF5CC1E5BD773EBDFB2347B77E2F68')

build() {
  mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
  
  ../${_realname}-${pkgver}/configure CPPFLAGS="-I${MINGW_PREFIX}/include/QtCore -D_XOPEN_SOURCE=600" \
    --prefix=${MINGW_PREFIX} \
    --enable-shared

  make
}

package() {
  cd "${srcdir}/build-${MSYSTEM}"
  make install DESTDIR="${pkgdir}"
  install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}
